//
//  Login.m
//  Delegate
//
//  Created by mac on 4/14/16.
//  Copyright (c) 2016 liuchengming. All rights reserved.
//

#import "Login.h"

@implementation Login
{
    NSString *name;
    NSString *password;
}
-(void)getName
{
    char name_[20];
    printf("请输入账号名：");
    scanf("%s",name_);
    name = [[NSString alloc] initWithCString:name_ encoding:NSUTF8StringEncoding];
    [self getPassword];
}
-(void)getPassword
{
    char passwd[20];
    printf("请输入密码：");
    scanf("%s",passwd);
    password =[[NSString alloc] initWithCString:passwd encoding:NSUTF8StringEncoding];
    if ([name isEqualToString:@"systme"] && [password isEqualToString:@"123456"])
    {
        
        [self.delegate WithName:name Password:password success:YES];
    }
    else
    {
        NSLog(@"登录失败！");
        [self.delegate WithName:name Password:password success:NO ];

    }
}

@end
